package com.shop.front.validate.course;

import com.shop.common.validator.annotation.IntegerContains;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;

@Data
@ApiModel("课程搜索参数")
public class CourseSearchValidate implements Serializable {

    private static final long serialVersionUID = 1L;

    @Length(max = 100, message = "关键词过长了")
    @ApiModelProperty(value = "关键词")
    private String keyword;

    @ApiModelProperty(value = "是否精选")
    @IntegerContains(values = {0, 1}, message = "参数错误")
    private Integer selected;

    @ApiModelProperty(value = "类型：1文章，2视频，3图片")
    @IntegerContains(values = {1, 2, 3}, message = "类型参数错误")
    private Integer type;

    @ApiModelProperty(value = "分类ID")
    private Integer categoryId;

    @ApiModelProperty(value = "排序:可选create_time, id, update_time, study_count")
    private String sort;

}
